﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using olierFrm.DataBase.FrameWork.StdQuery;
using System.Data;

namespace olierFrm.MVC
{
    public class UserRole
    {
        public const string StdQueryRole = "Frm_UserRole";
        public bool HavePower
        {
            get;
            private set;
        }
        public string PowerDesc
        {
            get;
            private set;
        }
        public string RoleDesc
        {
            get;
            private set;
        }
        public UserRole(string ModuleID = "^_^", string Business = "^_^")
        {
            StdQuerySQL std = new StdQuerySQL("Frm_UserRole");
            std.AddSystemParams();
            std.SetParam("ModuleID", ModuleID);
            std.SetParam("Business", Business);
            DataTable dt = std.ExecuteSQL();
            if (dt.Rows.Count != 0)
            {
                this.HavePower = true;
                this.PowerDesc = dt.Rows[0]["PowerDesc"].ToString();
                this.RoleDesc = dt.Rows[0]["RoleDesc"].ToString();
            }
        }
    }
}
